﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Configuration;
using System.Reflection;
using System.Threading;
namespace Launchr
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }
        private CGunZ currentUser = new CGunZ( );
        private bool loggedIn = false;
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.sourced.me/forum/");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if ( !loggedIn )
                {
                    loggedIn = currentUser.authenticateUser( textBox1.Text, maskedTextBox1.Text );
                }
                if ( !loggedIn )
                {
                    MessageBox.Show( "An unknown error occured", "Launchr: Error" );
                }
                else
                {
                    Thread t = new Thread(currentUser.startGunz);
                    t.Start( );
                }
            }
            catch ( Exception ex )
            {
                MessageBox.Show( ex.Message, "Launchr: Error" );
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
